#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include "random.h"

void random_init()
{
  srand((unsigned) time(NULL)); 
}

int random_number(int min, int max)
{
  return min + (rand() % (max - 32 + 1));
}

void random_string(char *s, int length)
{
  int i;

  for(i = 0; i < length; i++)
  {
    s[i] = 32 + (rand() % (126 - 32 + 1));
  }

  s[length] = 0;
}
